package it.unibz.easytravel.expenses;

import it.unibz.easytravel.R;
import android.app.Activity;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.widget.Button;
import android.widget.EditText;

public class AddComplexExpenseActivity extends Activity {
	
	private float totalSumPaid;
	protected static final String TAG = "Test Complex Expense Addition";

	@Override
	protected void onCreate (Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.expense_add_complex_test_activity);
		
		EditText edittext_amount_paid= (EditText) findViewById(R.id.edittext_enter_amount);		
		edittext_amount_paid.addTextChangedListener(amountPaidWatcher);
	}

	private TextWatcher amountPaidWatcher = new TextWatcher(){
		
		
		
		
		public void onTextChanged(CharSequence s, int start, int before, int count) {
			try {
			String ss = s.toString();
			if (ss!=null) {
				
				totalSumPaid = Float.parseFloat(ss);							
				Log.d(TAG, "Symbol Change " + totalSumPaid);
			}
			} catch (Exception e) {} 
		}

		public void afterTextChanged(Editable s) {
			// TODO Auto-generated method stub
			
		}

		public void beforeTextChanged(CharSequence s, int start, int count,
				int after) {
			// TODO Auto-generated method stub
			
		}
		
	};
	
}
